package com.example.rocketmq.springboot_test;

import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(consumerGroup = "testGroupZTK", topic = "testTopicZTK",
        consumeMode = ConsumeMode.CONCURRENTLY, messageModel = MessageModel.BROADCASTING)
public class SpringBootConsumer implements RocketMQListener<String> {
    @Override
    public void onMessage(String msg) {
        System.out.printf("消息接收成功，消息为：%s%n", msg);
    }
}
